package leetcode.editor.week.week308;

// 2390. 从字符串中移除星号
// https://leetcode.cn/problems/removing-stars-from-a-string/
public class Solution2390 {
    public String removeStars(String s) {
        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '*') {
                sb.deleteCharAt(sb.length() - 1);
            } else sb.append(s.charAt(i));
        }
        return sb.toString();
    }
}
